Code
pacman::p_load(sf,tidyverse,spNetwork,tmap,classInt, viridis)Tang Xin Yi
Prototype was done focusing on provinces of Thailand. Yet in the actual shiny app due to technical restrictions, we changed to be targeting at Bangkok districts only.
Reading layer `tha_admbnda_adm2_rtsd_20220121' from data source
`/Users/tangtang/Desktop/IS415 Geospatial Analytics and Applications/project/gga-ThaiRoad/data/thai_adm_boundary'
using driver `ESRI Shapefile'
Simple feature collection with 928 features and 19 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 97.34336 ymin: 5.613038 xmax: 105.637 ymax: 20.46507
Geodetic CRS: WGS 84
Some potential filtering to apply to dataset to allow user to zoom in into specific area he/she is interested in:
Accident categories
Fatal accident [yes/no]
Province (MUST-HAVE)
But let’s visualised the overall look
no yes
5974 107
driver_factors external_factors others speeding
413 167 506 4857
traffic_violations
138
< table of extent 0 >
Example: filter by province = “Bangkok”, accident_categories = “speeding”, fatal_accident == “yes” (Allowing users to change freely)